const qs = require('querystring');

const middleware = (rep,res,next)=>{
    let str = '';
    rep.on('data',(chunk)=>{
        str += chunk;
    });
    rep.on('end',()=>{
        rep.body = qs.parse(str);
        next();
    });
}
module.exports = middleware;